package com.lzw.mall.admin.controller;

import com.lzw.mall.common.service.IOrdersService;
import com.lzw.mall.common.vo.LayuiTableVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/orders")
public class OrdersController {
    @Autowired
    private IOrdersService orderService;

    @GetMapping("/index")
    public String index() {
        return "orders";
    }

    @GetMapping("/list")
    @ResponseBody
    public LayuiTableVO list(@RequestParam Integer page, @RequestParam Integer limit, @RequestParam(required = false,name = "keyword") String keyword, String status){
        return orderService.list(page, limit, keyword,status);
    }

    @PostMapping("/updateStatus")
    @ResponseBody
    public void updataStatus(@RequestParam("ids[]") Integer[] ids){
         orderService.updateStatus(ids);
    }




}
